home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 31 / Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso / -seriously_amiga- / sound / ahi / developer / filesave / filesave.h < prev    next >
C/C++ Source or Header  |  1998-07-16  |  3KB  |  94 lines

  1.  
  2. #include <libraries/iffparse.h>
  3. #include "Studio16file.h"
  4.  
  5. struct filesave {
  6.     UBYTE             fs_Flags;
  7.     UBYTE             fs_Pad1;
  8.     UWORD             fs_DisableCount;
  9.     BYTE             fs_EnableSignal;
  10.     BYTE             fs_DisableSignal;
  11.     BYTE             fs_MasterSignal;
  12.     BYTE             fs_SlaveSignal;
  13.     struct Process        *fs_MasterTask;
  14.     struct Process        *fs_SlaveTask;
  15.     struct FileRequester    *fs_FileReq;
  16.     struct Library        *fs_AHIsubBase;
  17.     ULONG             fs_Format;
  18.     APTR             fs_MixBuffer;
  19.     APTR             fs_SaveBuffer;
  20.     APTR             fs_SaveBuffer2;
  21.     ULONG             fs_SaveBufferSize;
  22.  
  23.     BYTE             fs_RecMasterSignal;
  24.     BYTE             fs_RecSlaveSignal;
  25.     struct Process        *fs_RecSlaveTask;
  26.     struct FileRequester    *fs_RecFileReq;
  27.     WORD            *fs_RecBuffer;
  28.  
  29. };
  30.  
  31.  
  32. #define AHIDB_FileSaveFormat    (AHIDB_UserBase+0)    /* Private tag */
  33. #define FORMAT_8SVX        0
  34. #define FORMAT_AIFF        1
  35. #define FORMAT_AIFC        2
  36. #define FORMAT_S16        3
  37.  
  38. /* AIFF, AIFC and 8SVX defs
  39.    AIFF and AIFC defines was taken from Olaf `Olsen' Barthel's AIFF DataType. */
  40.  
  41.     // 80 bit IEEE Standard 754 floating point number
  42.  
  43. typedef struct {
  44.     unsigned short    exponent;        // Exponent, bit #15 is sign bit for mantissa
  45.     unsigned long    mantissa[2];        // 64 bit mantissa
  46. } extended;
  47.  
  48.     // Audio Interchange Format chunk data
  49.  
  50. #define ID_AIFF MAKE_ID('A','I','F','F')
  51. #define ID_AIFC MAKE_ID('A','I','F','C')
  52.  
  53. #define ID_FVER MAKE_ID('F','V','E','R')
  54. #define ID_COMM MAKE_ID('C','O','M','M')
  55. #define ID_SSND MAKE_ID('S','S','N','D')
  56.  
  57.     // "COMM" chunk header
  58.  
  59. typedef struct {
  60.     short        numChannels;        // Number of channels
  61.     unsigned long    numSampleFrames;    // Number of sample frames
  62.     short        sampleSize;        // Number of bits per sample point
  63.     extended    sampleRate;        // Replay rate in samples per second
  64. } CommonChunk;
  65.  
  66.     // The same for "AIFC" type files
  67.  
  68. #define NO_COMPRESSION MAKE_ID('N','O','N','E') // No sound compression
  69.  
  70. typedef struct {
  71.     short        numChannels;        // Number of channels
  72.     unsigned long    numSampleFrames;    // Number of sample frames
  73.     short        sampleSize;        // Number of bits per sample point
  74.     extended    sampleRate;        // Replay rate in samples per second
  75.     unsigned long    compressionType;    // Compression type
  76.     char        compressionName[(sizeof("not compressed")+1)&(~1)];
  77. } ExtCommonChunk;
  78.  
  79.  
  80.     // "SSND" chunk header
  81.  
  82. typedef struct {
  83.     unsigned long    offset,         // Offset to sound data, for block alignment
  84.             blockSize;        // Size of block data is aligned to
  85. } SampledSoundHeader;
  86.  
  87.     // "FVER" chunk header
  88.  
  89. typedef struct {
  90.     long        timestamp;        // Format version creation date
  91. } FormatVersionHeader;
  92.  
  93. #define AIFCVersion1 0xA2805140         // "AIFC" file format version #1
  94.